package com.sdx.console.common.service;

import com.sdx.console.customer.entity.UserOperationLog;
import org.beetl.sql.core.SQLManager;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Date;

/**
 * @ClassName CommonService
 * @Description: No Description
 * @author: tanbaocai
 * @date: 2020/3/18 14:48
 */
@Service
@Transactional
public class CommonService {
	@Resource
	private SQLManager sqlManager;

	/**
	 * 操作日志
	 * @param customerId
	 * @param operType
	 * @param userId
	 * @param userName
	 * @param remark
	 */
	public void operLog(String customerId,Integer operType,Integer userId,String userName,String remark ) {
		UserOperationLog log = new UserOperationLog();
		log.setCustomerId(customerId);
		log.setOperationType(operType);
		log.setCreatedBy(userId);
		log.setCreatedName(userName);
		log.setCreatedTime(new Date());
		log.setOperationRemark(remark);
		sqlManager.insertTemplate(log);
	}
}
